package com.pwc.conversionTool.entity;

import java.io.Serializable;

import javax.persistence.Transient;
import org.codehaus.jackson.annotate.JsonIgnore;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;

@Entity
public class CsvDataType implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4799601022411643561L;

	@Id
	private Long id;

	private String lineSeparator;

	private String columnSepatator;
	
	@Index private Key<DataTemplate> dataTemplate;
	
	public CsvDataType() {
		
	}
	public CsvDataType(Key<DataTemplate> dataTemplate) {
		this.setDataTemplate(dataTemplate);
	}

	public CsvDataType(String lineSeparator,
			String columnSepatator,Key<DataTemplate> dataTemplate) {
		super();
		this.setLineSeparator(lineSeparator);
		this.setColumnSepatator(columnSepatator);
		this.setDataTemplate(dataTemplate);
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getColumnSepatator() {
		return columnSepatator;
	}

	public void setColumnSepatator(String columnSepatator) {
		this.columnSepatator = columnSepatator;
	}

	public String getLineSeparator() {
		return lineSeparator;
	}

	public void setLineSeparator(String lineSeparator) {
		this.lineSeparator = lineSeparator;
	}

	@JsonIgnore
	public Key<DataTemplate> getDataTemplate() {
		return dataTemplate;
	}

	public void setDataTemplate(Key<DataTemplate> dataTemplate) {
		this.dataTemplate = dataTemplate;
	}
	
	@JsonIgnore
	@Transient
	public Key<CsvDataType> getKey() {
	   return Key.create(CsvDataType.class, id);
	}
	
	

}
